<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="common/header.jsp"%>
<div class="clearfix"></div>
<div class="row">
  <div class="col-md-12 col-sm-12 col-xs-12">
    <div class="x_panel">
      <div class="x_title">
        <h2>查看销售信息 <i class="fa fa-user"></i><small>${devUserSession.devName}</small></h2>
             <div class="clearfix"></div>
      </div>
      <div class="x_title">
            <h2>添加销售明细</h2>
          <div class="clearfix"></div>
      </div>
      <div class="x_content1">
        <form class="form-horizontal form-label-left" action="${pageContext.request.contextPath }/viewadd" method="post">
        							<c:forEach var="appVersion" items="${lists }" varStatus="status">
								         <input type="hidden" name="marketId" value="${appVersion.marketId}">
							</c:forEach>
 
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">商品名称 <span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
<select name="goodsnames" id="goods" class="form-control"  required="required">
<option value="0">请选择...</option>
              <c:forEach var="listname" items="${list }">
              <option value="${listname.gid }">${listname.gName}</option>
              </c:forEach>
              </select>
            </div>
          </div>
                    <input type="hidden" id="goodsname" name="goodsname">
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">数量<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="number" id="softwareSize" name="count"   required="required" onkeyup="value=value.replace(/[^\d]/g,'')"
              data-validate-minmax="10,500"  placeholder="请输入数量" class="form-control col-md-7 col-xs-12">
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">单价<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
                  <input type="text" id="downloads" name="price"   required="required"
              data-validate-minmax="10,500" readonly="readonly"  placeholder="" class="form-control col-md-7 col-xs-12">
            </div>
          </div>
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">总价<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="supportROM" class="form-control col-md-7 col-xs-12" name="money" 
              	data-validate-length-range="20" data-validate-words="1"   required="required"
              	placeholder="" readonly="readonly" type="text">
            </div>
          </div>
              <div class="form-group">
        <div class="col-md-6 col-md-offset-3">
          <input type="submit" class="btn btn-primary" id="back"value="保存">
          
        </div>
      </div>

        </form>
        </div>
        <div class="clearfix"></div>
        <div class="x_title">
            <h2>销售明细信息</h2>
            <ul class="nav navbar-right panel_toolbox">
              <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
              </li>
            </ul>
          <div class="clearfix"></div>
        </div>
        <div class="x_content" style="display: block;">
         <br>
        <div id="datatable-responsive_wrapper"
			class="dataTables_wrapper form-inline dt-bootstrap no-footer">
			<div class="row">
				<div class="col-sm-12">
					<table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
						cellspacing="0" width="100%" role="grid" aria-describedby="datatable-responsive_info" style="width: 100%;">
						<thead>
							<tr role="row">
								<th class="sorting_asc" tabindex="0"
									aria-controls="datatable-responsive" rowspan="1" colspan="1"
									style="width: 70px;" aria-label="First name: activate to sort column descending"
									aria-sort="ascending">销售单号</th>
								<th class="sorting" tabindex="0"
									aria-controls="datatable-responsive" rowspan="1" colspan="1"
									style="width: 10px;"
									aria-label="Last name: activate to sort column ascending">
									商品名称</th>
								<th class="sorting" tabindex="0"
									aria-controls="datatable-responsive" rowspan="1" colspan="1"
									style="width: 90px;"
									aria-label="Last name: activate to sort column ascending">
									数量</th>
								<th class="sorting" tabindex="0"
									aria-controls="datatable-responsive" rowspan="1" colspan="1"
									style="width: 50px;"
									aria-label="Last name: activate to sort column ascending">
									单价</th>
								<th class="sorting" tabindex="0"
									aria-controls="datatable-responsive" rowspan="1" colspan="1"
									style="width: 50px;"
									aria-label="Last name: activate to sort column ascending">
									金额</th>
								<th class="sorting" tabindex="0"
									aria-controls="datatable-responsive" rowspan="1" colspan="1"
									style="width: 50px;"
									aria-label="Last name: activate to sort column ascending">
									执行状态</th>
										<th class="sorting" tabindex="0"
									aria-controls="datatable-responsive" rowspan="1" colspan="1"
									style="width: 50px;"
									aria-label="Last name: activate to sort column ascending">
									操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="appVersion" items="${lists }" varStatus="status">
								<tr role="row" class="odd">
									<td tabindex="0" class="sorting_1" id="marketid">${appVersion.marketId}</td>
									<td>${appVersion.goodsname }</td>
									<td>${appVersion.count }</td>
									<td>${appVersion.price }</td>
									<td>${appVersion.money }</td>
									<td>
									<span><c:if test="${appVersion.isreturn==1 }">未出库</c:if>
						                      <c:if test="${appVersion.isreturn==2 }">已出库</c:if>
						                        <c:if test="${appVersion.isreturn==3 }">已退货</c:if>
					                </span>
									</td>
									<td> 
									 <button type="button" class="btn btn-danger cha" chukuid="${appVersion.marketodd}" return="${appVersion.isreturn}">删除</button>
                      <button type="button" class="btn btn-danger return" gname="${kucunlist.goodsname}" gshu="${kucunlist.count }" chukuid="${appVersion.marketodd}" goodsname="${appVersion.goodsname}" return="${appVersion.isreturn}">退货申请</button>
									<span>
									<c:if test="${appVersion.ismarket==1 }">退货申请中</c:if>
									</span>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
			</div>
      </div>
    </div>
     <div class="form-group">
        <div class="col-md-6 col-md-offset-3">
          <button type="button" class="btn btn-primary" id="backsdsad">返回</button>
        </div>
      </div>
    <div class="clearfix"></div>
    <br/><br/>
  </div>
</div>
<%@include file="common/footer.jsp"%>
<script src="${pageContext.request.contextPath }/statics/xiaoshou/appinfoview.js"></script>